
/**
 * @param {WebMail} oWebMail
 * @param {WebMailMailScreen} oScreen
 * @return {WebMailScreenPrefetch}
 */
WebMailScreenPrefetch = function (oWebMail, oScreen)
{
	this.timeIterval = 3000;
	this.timer = null;
	this.webmail = oWebMail;
	this.screen = oScreen;

	this.action = null;
	this.data = null;
	return this;
}

/**
 * @return {void}
 */
WebMailScreenPrefetch.prototype =
{
	startPrefetch: function ()
	{
		var obj = this;
		var setTimeoutHandle = function ()
		{
			//TODO
			if (null !== this.action)
			{

			}
			obj.startPrefetch();
		}

		if (null !== this.timer)
		{
			clearTimeout(this.timer);
			this.timer = null;
		}
		this.timer = setTimeout(setTimeoutHandle, this.timeIterval);
	},

	/**
	 * @param {string} sAction
	 * @param {object} oItem
	 * @return {void}
	 */
	currentData: function (sAction, oItem)
	{
		switch (sAction)
		{
			case 'GetList':
				this.action = sAction;
				this.data = oItem;
				break;
		}
		this.startPrefetch();
	}
}